<template>
	<view class="page">
		<view class="header">
			<yzh-header :title="'商家管理'" :bgColor="'#609299'"></yzh-header>
			<!-- #ifdef MP-WEIXIN -->
			<image src="@/static/yzh/tower.jpg"></image>
			<!-- #endif -->
		</view>
		<view class="body">
			<view class="info">
				<uni-card>
					<view class="content">
						<view>
							<text>负责人：</text>
							<text>{{shopInfo.person}}</text>
						</view>
						<view>
							<text>身份证号码：</text>
							<text>{{shopInfo.idCard}}</text>
						</view>
						<view>
							<text>手机号：</text>
							<text>{{shopInfo.phone}}</text>
						</view>
						<view>
							<text>店名：</text>
							<text>{{shopInfo.name}}</text>
						</view>
						<view>
							<text>工商营业执照号码：</text>
							<text>{{shopInfo.permission}}</text>
						</view>
						<view>
							<text>经营区域：</text>
							<text>{{shopInfo.area}}</text>
						</view>
						<view>
							<text>地址：</text>
							<text>{{shopInfo.address}}</text>
						</view>
					</view>
				</uni-card>
			</view>
			<view class="intro">
				<uni-card title="商家简介">
					<view class="content">
						<view>
							<text>{{shopInfo.intro}}</text>
						</view>
					</view>
				</uni-card>
			</view>
			<view class="idCard">
				<uni-card title="身份证正反面照片">
					<view class="content">
						<image :src="shopInfo.idCardPhoto.front"></image>
						<image :src="shopInfo.idCardPhoto.behind"></image>
					</view>
				</uni-card>
			</view>
			<view class="permission">
				<uni-card title="营业执照">
					<view class="content">
						<image :src="shopInfo.perPhoto"></image>
					</view>
				</uni-card>
			</view>
			<view class="shopPhoto">
				<uni-card title="门店照片">
					<view class="content">
						<image :src="shopInfo.shopPhoto"></image>
					</view>
				</uni-card>
			</view>
		</view>
		<view class="btn">
			<u-button type="primary" text="修改" @click="toEdit"></u-button>
		</view>
	</view>
</template>

<script>
	import Header from "@/components/Header/Header.vue";
	export default {
		components: {
			'yzh-header': Header
		},
		data() {
			return {
				shopInfo: {
					person: "张大美",
					idCard: "4401234567890X",
					phone: "19999999999",
					name: "张大美汽修店",
					permission: "1232134214432",
					area: "河南省焦作市山阳区",
					address: "山阳区迎宾路23号",
					intro: "这里是简介简介",
					idCardPhoto: {
						front: "../../../static/c1.png",
						behind: "../../../static/c1.png"
					},
					perPhoto: "../../../static/c1.png",
					shopPhoto: "../../../static/c1.png"
				}
			}
		},
		methods: {
			toEdit() {
				let shopInfoStr = encodeURIComponent(JSON.stringify(this.shopInfo))
				uni.navigateTo({
					url: "/pages/yzh/ShopR/ShopR?shopInfo=" + shopInfoStr
				})
			}
		}
	}
</script>

<style scoped>
	.page {
		/* #ifndef MP-WEIXIN */
		background-image: url('@/static/yzh/tower.jpg');
		background-size: cover;
		background-position: contain;
		background-repeat: no-repeat;
		height: 140vh;
		/* #endif */
	}

	.header {}

	.header>image {
		width: 100%;
		height: 100%;
		position: absolute;
		z-index: -1;
	}

	.body {
		display: flex;
		flex-direction: column;
		justify-content: space-evenly;
		width: 100%;
		margin: 0 auto;
		margin-top: 140rpx;
	}

	.info .content>view {
		display: flex;
		justify-content: space-between;
		margin-top: 20rpx;
	}

	.idCard,
	.intro,
	.permission,
	.shopPhoto {
		margin-top: -50rpx;
	}

	.idCard .content {
		display: flex;
	}

	.idCard .content>image:nth-child(2) {
		margin-left: 20rpx;
	}

	.idCard .content>image,
	.permission .content>image,
	.shopPhoto .content>image {
		width: 150rpx;
		height: 150rpx;
		border-radius: 20rpx;
		border: 2rpx solid red;
	}
</style>